package ltd.dujiabao.springcloud.controller;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * @author : DuJiabao
 * @Project : springcloud
 * @Time : 2021/5/21 16:39
 * @Desc :
 */
@Api("Payment")
@Slf4j
@RestController
@RequestMapping("/payment")
public class PaymentController {
  @Value("${server.port}")
  private String serverPort;

  @GetMapping(value = "/consul")
  public String paymentConsul() {
    String result = "SpringCloud with consul: " + serverPort + "\t" + UUID.randomUUID().toString();
    log.info("生成消息：" + result);
    return result;
  }
}
